package club.vann.mock.model.enums;

import java.util.HashMap;
import java.util.Map;
import lombok.Getter;

/**
 * 策略操作:
 *
 * <ol>
 *   <li>INIT: 策略初始化
 *   <li>START: 策略启动
 *   <li>STOP: 策略停止
 *   <li>MERGE_CHECK: 策略合并检查
 *   <li>MERGE: 策略合并
 * </ol>
 */
@Getter
public enum StrategyAction {
  /** 策略初始化 */
  INIT("INIT", "策略初始化"),
  /** 策略启动 */
  START("START", "策略启动"),
  /** 策略停止 */
  STOP("STOP", "策略停止"),
  /** 策略合并检查 */
  MERGE_CHECK("MERGE_CHECK", "策略合并检查"),
  /** 策略合并 */
  MERGE("MERGE", "策略合并"),
  ;

  private final String code;
  private final String desc;
  private static final Map<String, StrategyAction> MAPPING;

  static {
    MAPPING = new HashMap<>();
    for (StrategyAction strategyAction : StrategyAction.values()) {
      MAPPING.put(strategyAction.getCode(), strategyAction);
    }
  }

  StrategyAction(String code, String desc) {
    this.code = code;
    this.desc = desc;
  }
}
